<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>uvgRTP: uvgrtp::context Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">uvgRTP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>uvgrtp</b></li><li class="navelem"><a class="el" href="classuvgrtp_1_1context.html">context</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classuvgrtp_1_1context-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">uvgrtp::context Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a98be18c2848404549cfadf910ba1573a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1context.html#a98be18c2848404549cfadf910ba1573a">context</a> ()</td></tr>
<tr class="memdesc:a98be18c2848404549cfadf910ba1573a"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTP context constructor.  <a href="classuvgrtp_1_1context.html#a98be18c2848404549cfadf910ba1573a">More...</a><br /></td></tr>
<tr class="separator:a98be18c2848404549cfadf910ba1573a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a652a201ae11685961267455ab823eb60"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1context.html#a652a201ae11685961267455ab823eb60">~context</a> ()</td></tr>
<tr class="memdesc:a652a201ae11685961267455ab823eb60"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTP context destructor.  <a href="classuvgrtp_1_1context.html#a652a201ae11685961267455ab823eb60">More...</a><br /></td></tr>
<tr class="separator:a652a201ae11685961267455ab823eb60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa109aa2a419933359d225d19bcf3b2f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1context.html#aa109aa2a419933359d225d19bcf3b2f9">create_session</a> (std::string addr)</td></tr>
<tr class="memdesc:aa109aa2a419933359d225d19bcf3b2f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new RTP session.  <a href="classuvgrtp_1_1context.html#aa109aa2a419933359d225d19bcf3b2f9">More...</a><br /></td></tr>
<tr class="separator:aa109aa2a419933359d225d19bcf3b2f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0007eebfd5131bf0930cfedc0c4018e8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1context.html#a0007eebfd5131bf0930cfedc0c4018e8">create_session</a> (std::string remote_addr, std::string local_addr)</td></tr>
<tr class="memdesc:a0007eebfd5131bf0930cfedc0c4018e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new RTP session.  <a href="classuvgrtp_1_1context.html#a0007eebfd5131bf0930cfedc0c4018e8">More...</a><br /></td></tr>
<tr class="separator:a0007eebfd5131bf0930cfedc0c4018e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61daf2f3cdcdf2542ee997ab6de5efa9"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1context.html#a61daf2f3cdcdf2542ee997ab6de5efa9">destroy_session</a> (<a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> *<a class="el" href="classuvgrtp_1_1session.html">session</a>)</td></tr>
<tr class="memdesc:a61daf2f3cdcdf2542ee997ab6de5efa9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy RTP session and all of its media streams.  <a href="classuvgrtp_1_1context.html#a61daf2f3cdcdf2542ee997ab6de5efa9">More...</a><br /></td></tr>
<tr class="separator:a61daf2f3cdcdf2542ee997ab6de5efa9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a98be18c2848404549cfadf910ba1573a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a98be18c2848404549cfadf910ba1573a">&#9670;&nbsp;</a></span>context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uvgrtp::context::context </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>RTP context constructor. </p>
<p>Most of the time one RTP context per application is enough. If CNAME namespace isolation is required, multiple context objects can be created. </p>

</div>
</div>
<a id="a652a201ae11685961267455ab823eb60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a652a201ae11685961267455ab823eb60">&#9670;&nbsp;</a></span>~context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uvgrtp::context::~context </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>RTP context destructor. </p>
<p>This does not destroy active sessions. They must be destroyed manually by calling <a class="el" href="classuvgrtp_1_1context.html#a61daf2f3cdcdf2542ee997ab6de5efa9" title="Destroy RTP session and all of its media streams.">uvgrtp::context::destroy_session()</a> </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa109aa2a419933359d225d19bcf3b2f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa109aa2a419933359d225d19bcf3b2f9">&#9670;&nbsp;</a></span>create_session() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a>* uvgrtp::context::create_session </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new RTP session. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>IPv4 address of the remote participant</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP session object</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a></td><td>On success </td></tr>
    <tr><td class="paramname">nullptr</td><td>If "addr" is empty </td></tr>
    <tr><td class="paramname">nullptr</td><td>If memory allocation failed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0007eebfd5131bf0930cfedc0c4018e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0007eebfd5131bf0930cfedc0c4018e8">&#9670;&nbsp;</a></span>create_session() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a>* uvgrtp::context::create_session </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>remote_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>local_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new RTP session. </p>
<p>If UDP holepunching should be utilized, in addition to remote IP address, the caller must also provide local IP address where uvgRTP should bind itself to. If you are using uvgRTP for unidirectional streaming, please take a look at <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2afa8e66f45819774772a0156647d3788a95">RCE_HOLEPUNCH_KEEPALIVE</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">remote_addr</td><td>IPv4 address of the remote participant </td></tr>
    <tr><td class="paramname">local_addr</td><td>IPv4 address of a local interface</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP session object</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a></td><td>On success </td></tr>
    <tr><td class="paramname">nullptr</td><td>If remote_addr or local_addr is empty </td></tr>
    <tr><td class="paramname">nullptr</td><td>If memory allocation failed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a61daf2f3cdcdf2542ee997ab6de5efa9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61daf2f3cdcdf2542ee997ab6de5efa9">&#9670;&nbsp;</a></span>destroy_session()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rtp_error_t uvgrtp::context::destroy_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> *&#160;</td>
          <td class="paramname"><em>session</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy RTP session and all of its media streams. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>Pointer to the session object that should be destroyed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
    <tr><td class="paramname">RTP_INVALID_VALUE</td><td>If session is nullptr </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/<a class="el" href="lib_8hh_source.html">lib.hh</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
